UNIT escreva;

Interface

uses


Crt,Dos,Graph,GlobVar;

procedure WriteText(x  :  integer;
                    y  :  integer;

                    S  :  string);
procedure WriteTextclaro(x,y  :  integer;
                         S  :  string);
procedure MarcaText(x,y  :  integer;
                         S  :  string);
procedure MarcaTextclaro(x,y  :  integer;
                         S  :  string);
procedure MarcaTexto(x,y  :  integer;
                         S  :  string);
function Int2Str(L : Integer) : string;
function Real2Str(L : real) : string;
function Real0Str(L : real) : string;
function Real1Str(L : real) : string;
procedure WriteT(x  :  integer;
                    y  :  integer;
                    S  :  string);



Implementation

function Int2Str(L : Integer) : string;
{ Converts an integer to a string for use with OutText, OutTextXY }
var
  S : string;
begin
  Str(L, S);
  Int2Str := S;
end; { Int2Str }

function Real2Str(L : real) : string;
{ Converts a real to a string for use with OutText, OutTextXY }
var
  S : string;
begin
  Str(L:3:2, S);
  real2Str := S;
end; { Int2Str }

function Real0Str(L : real) : string;
{ Converts a real to a string for use with OutText, OutTextXY }
var
  S : string;
begin
  Str(L:3:0, S);
  real0Str:= S;
end; { Int2Str }

function Real1Str(L : real) : string;
{ Converts a real to a string for use with OutText, OutTextXY }
var
  S : string;
begin
  Str(L:3:1, S);
  real1Str:= S;
end; { Int2Str }


procedure WriteText(x  :  integer;
                    y  :  integer;
                    S  :  string);
begin
  SetViewPort(X,Y,X+50,Y+9,ClipOff);
  bar(0,0,30,9);
  {clearViewPort;}
  OutText(S);
  SetViewPort(InitX,InitY,FinX,FinY,clipOn);
end;

procedure WriteT(x  :  integer;
                    y  :  integer;
                    S  :  string);
begin
  SetViewPort(X,Y,X+50,Y+9,ClipOff);
  bar(0,0,45,9);
  {clearViewPort;}
  OutText(S);
  SetViewPort(InitX,InitY,FinX,FinY,clipOn);
end;

procedure WriteTextclaro(x,y  :  integer;
                         S  :  string);
begin
  SetViewPort(X,Y,X+30,Y+9,ClipOff);
  setcolor(15);
  bar(0,0,30,9);
  {clearViewPort;}
  OutText(S);
  SetViewPort(InitX,InitY,FinX,FinY,clipOn);
  setcolor(9);
  setcolor(15);
end;


procedure MarcaText(x,y  :  integer;
                         S  :  string);
begin
   repeat
      begin
         SetViewPort(X,Y,X+50,Y+9,ClipOff);
         bar(0,0,50,9);
         delay(100);
         OutText(S);
         delay(100)
       end;
   Until KeyPressed;
   setcolor(9);
   bar(0,0,50,Y+9);
   {clearviewport;}
   OutText(S);
 SetViewPort(InitX,InitY,FinX,FinY,clipOn);
 setcolor(15);
end;

procedure MarcaTextclaro(x,y  :  integer;
                         S  :  string);
begin
   repeat
      begin
         SetViewPort(X,Y,X+50,Y+9,ClipOff);
         bar(0,0,50,9);
         {clearViewPort;}
         delay(100);
         OutText(S);
         delay(100)
       end;
   Until KeyPressed;
    SetViewPort(InitX,InitY,FinX,FinY,clipOn);
    setcolor(15);
end;

procedure MarcaTexto(x,y  :  integer;
                         S  :  string);
begin
  setfillstyle(11,9);
  SetViewPort(X,Y,X+100,Y+9,ClipOff);
  bar(0,50,100,59);
  setcolor(14);
  OutTextXY(0,50,S);
  SetViewPort(InitX,InitY,FinX,FinY,clipOn);
  setcolor(15);
end;
end.

